import API from "@/utils/request";

//获取当前角色的权限
export function getPermissionByRole(role){
    API.post('/permission/getByRoles',role)
}

export function getPagePermission({pageNum,pageSize,name}){
    return API.get('/permission/page',{
        params:{
            pageNum,
            pageSize
        }
    })
}

export function getAllPermission(){
    return API.get('/permission')
}

export function getPermissionById(id){
    return API.get(`/permission/${id}`)
}

export function savePermission(permission){
    return API.post('/permission',permission)
}

export function updatePermission(permission){
    return API.put('/permission',permission)
}

export function removePermission(id){
    return API.delete(`/permission/${id}`)
}